<!DOCTYPE html>
<html>
	<head>
		<link rel="stylesheet" href="css/car.css" type="text/css" />
		<link rel="stylesheet" href="css/base.css" type="text/css" />
		<link rel="stylesheet" href="css/common.css" type="text/css" />
		<script type="text/javascript" src="js/jquery-3.4.1.min.js"></script>
		<style>
			.one-shop {
				width: 400px;
			}
		</style>
	</head>
	<body>
		<div class="one-shop">
			<div class="one-goods">
				<div class="goods-msg">
					<label>
						<input type="checkbox" class="goods-check GoodsCheck" />
						JQuery框架基础知识
					</label>
					<button type="button" class="minus">=</button>
					<input type="text" class="am-num-text" value="1" />
					<button type="button" class="plus">+</button>
					<button type="button" class="jian">-</button>
				</div>
				<p>
					商品单价：¥<span class="shop-total-amount GoodsPrice">30.00</span>
				</p>
			</div>
		</div>
		<script>
			// 对按钮+ 完成数量添加
			$(".plus").click(function() {
				var t = $(this).parent().find('.am-num-text');
				var s = t.val();
				console.log(s);
				t.val(parseInt(s) + 1);
				if (t.val() <= 1) {
					t.val(1);
				}
			})
		</script>
		<script>
			// 对按钮- 完成数量减少
			$(".jian").click(function() {
				var t = $(this).parent().find('.am-num-text');
				var s = t.val();
				console.log(s);
				t.val(parseInt(s) - 1);
				if (t.val() <= 1) {
					t.val(1);
				}
			})
		</script>
	</body>
</html>